{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--app使用统计{% endblock %}

{% block panel_heading %}
  万屏时代OPC--app使用统计
{% endblock %}

{% block panel_body %}
    <form id="search-demand-form" action="{{ url_for('op_bp.app_usage_list') }}" method="post" class="form" role="form">
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <a
                    href="{{ url_for('op_bp.operate_stat_export_app_users') }}"
                    class="btn-group btn btn-primary"
            >导出</a>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.app_usage_list', **url_kwargs) }}
    </div>
    {% endif %}
    <table id="user-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>ID</th>
                <th>昵称</th>
                <th>手机</th>
                <th>首次登录时间</th>
                <th>最后使用时间</th>
                <th>APP版本号</th>
            </tr>
        </thead>
        <tbody>
            {% for each in data %}
                <tr>
                    <td>{{ each.id }}</td>
                    <td>{{ each.nickname }}</td>
                    <td>{{ each.mobile | encrypt }}</td>
                    <td>{{ each.app_first_login_time or ''}}</td>
                    <td>{{ each.app_last_visit_time }}</td>
                    <td>{{ each.app_login_version }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.app_usage_list', **url_kwargs) }}
    </div>
    {% endif %}
{% endblock %}
